<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
	<meta equiv="Content-type" content="text/html; charset=utf8" />
	
	<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
	<script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script>
	<script type="text/javascript" src="js/jquery.flydom-3.1.1.js"></script>
	<link type="text/css" href="css/ui-lightness/jquery-ui-1.7.2.custom.css" rel="Stylesheet" />
	
	<link type="text/css" href="css/database-diagram-0.1.css" rel="Stylesheet" />
	<script type="text/javascript" src="js/database-diagram-parser-0.1.js"></script>
	<script type="text/javascript" src="js/database-diagram-graph-0.1.js"></script>
	<script type="text/javascript" src="js/database-diagram-storage-0.1.js"></script>
	<script type="text/javascript" src="js/database-diagram-0.1.js"></script>
	
<script type="text/javascript">
	
$(document).ready(function(){});

function go()
{
	dbd($("#sql").val());
}

</script>
</head>
<body>


<canvas id="canvas"></canvas>
<div style="padding-top: 640px;">

<input type="button" onclick="go()" value="moo">

<textarea id="sql">
/*
SQLyog Enterprise - MySQL GUI v8.05 
MySQL - 5.0.45-community : Database - zz
*********************************************************************
*/


/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

CREATE DATABASE /*!32312 IF NOT EXISTS*/`zz` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;

USE `zz`;

/*Table structure for table `clients` */

DROP TABLE IF EXISTS `clients`;

CREATE TABLE `clients` (
  `id` int(11) NOT NULL auto_increment,
  `coool` int(11) default NULL,
  `q` int(11) default NULL,
  `r` int(11) default NULL,
  `manager_id` int(11) default NULL,
  PRIMARY KEY  (`id`),
  KEY `FK_clients` (`manager_id`),
  CONSTRAINT `FK_clients` FOREIGN KEY (`manager_id`) REFERENCES `staff` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='comments zooom';

/*Table structure for table `orders` */

DROP TABLE IF EXISTS `orders`;

CREATE TABLE `orders` (
  `id` int(11) NOT NULL auto_increment,
  `fk_client` int(11) default NULL,
  PRIMARY KEY  (`id`),
  KEY `FK_orders` (`fk_client`),
  CONSTRAINT `FK_orders` FOREIGN KEY (`fk_client`) REFERENCES `clients` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='comment woop woop';

/*Table structure for table `staff` */

DROP TABLE IF EXISTS `staff`;

CREATE TABLE `staff` (
  `id` int(11) NOT NULL,
  `name` varchar(123) collate utf8_unicode_ci default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;

</textarea>

<h2>Test: MySQL - InnoDB</h2>
<p>
Tests:
<ul>
	<li>CONSTRAINT `FK_orders` FOREIGN KEY (`fk_client`) REFERENCES `clients` (`id`)
</p>

</div>
</body>
</html>